home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 19
/
Night Owl (The Best of Shareware)(NOPV 19)(1996).ISO
/
007a
/
tgbbsed1.zip
/
TGBBSED.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1995-11-25
|
5KB
|
147 lines
{Telegard 3.0 BBS List Freeware Editor}
{This program canot be used or modified for profit}
Program TGBBSED;
USES DOS,CRT;
TYPE {Taken from Telegard developement package}
unixtime = longint;
bbslistrec= { *.BBS : BBS Listings }
record
phone : string[20]; { BBS Phone Number }
name, { BBS Name }
sysop : string[30]; { BBS SysOp Name }
description : string[30]; { Other Description }
speed : string[4]; { Speed }
software : string[8]; { Software }
firstdate, { First date added }
lastedit : unixtime; { Last date edited }
editor : string[36]; { entry editor }
end;
VAR BBSFILE:file of bbslistrec;
BBSNUM:bbslistrec;
PATH,TEMPSTR:STRING;
NUM,TEMPNUM,CURNUM:INTEGER;
function exist(filename:string):boolean;
var tfile:text;
s: string;
begin
s := FSEARCH(Filename,'');
exist := s <> '';
end;
procedure stringedit(var stringname:string);
var tt:string;
begin
WRITELN;
writeln('Previous string : '+Stringname);
write('Current string : ');readln(tt);
if length(tt)>0 then stringname:=tt;
end;
procedure goprogram;
VAR A:CHAR;
begin
CURnum:=0;
STR(NUM,TEMPSTR);
writeln('There are currently '+TEMPSTR+' BBS''s in '+PATH);
delay(500);
reset(BBSFILE);
Seek(BBSFILE,CURnum);
Read(BBSFILE,BBSNUM);
repeat
CLRSCR;
str(curnum+1,tempstr);
writeln('BBS Entry #'+tempstr);
writeln('[1] BBS Name = '+BBSNuM.name);
writeln('[2] Phone Number = '+BBSNuM.phone);
writeln('[3] Sysop Name = '+BBSNuM.sysop);
writeln('[4] Description = '+BBSNuM.description);
writeln('[5] Modem Speed = '+BBSNuM.speed);
writeln('[6] Software = '+BBSNum.software);
writeln('[G] Goto BBS Number, ] move one directory ahead, [ move one directory back');
writeln('or hit [*] to clear this entry, and [S] to save this BBS entry');
write('1-6,*,[,],G,or (Q = Quit) : ');repeat until keypressed;a:=readkey;
a:=upcase(a);
case a of
'1','2','3','4','5','6':begin
if a='1' then TEMPSTR:=BBSNUM.name;
if a='2' then TEMPSTR:=BBSNUM.phone;
if a='3' then TEMPSTR:=BBSNUM.sysop;
if a='4' then TEMPSTR:=BBSNUM.description;
if a='5' then TEMPSTR:=BBSNUM.speed;
if a='6' then TEMPSTR:=BBSNUM.software;
STRINGEDIT(TEMPSTR);
if a='1' then BBSNUM.name:=TEMPSTR;
if a='2' then BBSNUM.phone:=TEMPSTR;
if a='3' then BBSNUM.sysop:=TEMPSTR;
if a='4' then BBSNUM.description:=TEMPSTR;
if a='5' then BBSNUM.speed:=TEMPSTR;
if a='6' then BBSNUM.software:=TEMPSTR;
end;
'G':begin
WRITELN;WRITELN;
STR(NUM,TEMPSTR);
write('Jump to which entry? (1-'+TEMPSTR+') :');readln(tempnum);
if (tempnum<=num) AND (tempnum > 0) then begin
CURNUM:=TEMPNUM-1;
RESET(BBSFILE);
Seek(BBSFILE,CURNUM);
Read(BBSFILE,BBSNUM);
end;
end;
'[':if (CURnum-1 >= 0) then begin
CURNUM:=CURNUM-1;
RESET(BBSFILE);
Seek(BBSFILE,CURNUM);
Read(BBSFILE,BBSNUM);
end;
']':if (CURnum+1 < num) then begin
CURNUM:=CURNUM+1;
RESET(BBSFILE);
Seek(BBSFILE,curnum);
Read(BBSFILE,BBSNUM);
end;
'*':begin
tempstr:='';
BBSNUM.name:=TEMPSTR;
BBSNUM.phone:=TEMPSTR;
BBSNUM.sysop:=TEMPSTR;
BBSNUM.description:=TEMPSTR;
BBSNUM.speed:=TEMPSTR;
BBSNUM.software:=TEMPSTR;
end;
'S':BEGIN
RESET(BBSFILE);
SEEK(BBSFILE,CURNUM);
write(BBSFILE,BBSNUM);
END;
end;
until A='Q';
end;
BEGIN
path:=paramstr(1);
if (length(path) < 1) then begin
WRITELN;WRITELN;
writeln('What is the path and filename of the Telegard BBS List?');
write('(Default = C:\TG\DATA\BBSLIST.BBS) : ');Readln(Path);
end;
if (length(path) < 1) then path := 'C:\TG\DATA\BBSLIST.BBS';
if not(exist(path)) then begin
writeln;
writeln('Path not found error');
writeln('Proper command line = TGBBSED.EXE C:\TG\DATA\BBSLIST.BBS');
halt(0);
end;
assign(BBSFILE,Path);
reset(BBSFILE);
num:=0;
repeat
read(BBSFILE,BBSNUM);
inc(NUM);
until eof(BBSFILE);
GOPROGRAM;
close(BBSFILE);
END.